import math
class sphere:
    def __init__(slef,r):
        slef.r=r
    def get_s():
        print(f'{4*math.pi*r**2:.2f}')
    def get_v():
        print(f'{(4/3)*math.pi*r*r*r:.2f}')
class cylinder:
    def __int__(slef,r,h):
        slef.r=r
        slef.h=h
    def get_s():
        print(f'{2*math.pi*r**2+2*math.pi*r*h:.2f}')
    def get_v():
        print(f'{math.pi*r**2*h:.2f}')
r=float(input())
h=float(input())
sphere.r=r
cylinder.r=r
cylinder.h=h
sphere.get_v()
sphere.get_s()
cylinder.get_v()
cylinder.get_s()
